<script>
	import store from '@/store/index.js';
	import Vue from 'vue';
	import {
		mapActions,
		mapMutations
	} from 'vuex'
	export default {
		methods: {
			...mapActions(['getUserPrefile']),
			// 获取系统栏高度
			   setAppInfo() {
				let that = this;
				let platform = '';
				return new Promise((resolve, reject) => {
					uni.getSystemInfo({
						success: function(e) {
							Vue.prototype.StatusBar = e.statusBarHeight;
							// #ifdef H5
							Vue.prototype.CustomBar = e.statusBarHeight + 45;
							// #endif
	
							// #ifdef APP-PLUS
							platform = 'App';
							if (e.platform == 'android') {
								uni.setStorageSync('isAndroid', true);
								Vue.prototype.CustomBar = e.statusBarHeight + 50;
							} else {
								Vue.prototype.CustomBar = e.statusBarHeight + 45;
								uni.setStorageSync('isAndroid', false);
							}
							// #endif
							resolve(platform);
						}
					});
				});
			}
		},
		onLaunch: async function(e) {
			this.setAppInfo();
			//取出缓存数据
			store.commit('setCacheData');
			// #ifdef APP-PLUS
			APPUpdate();
			// #endif
		},
		created() {
			this.getUserPrefile();
		},
	}
</script>

<style>
	/*每个页面公共css */
</style>


<style lang="scss">
	/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
	@import "uview-ui/index.scss";
</style>